<!-- HTML header for doxygen 1.9.1-->
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <meta name="generator" content="Doxygen 1.9.4" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>NumCpp: nc::edac::detail Namespace Reference</title>
    <link href="tabs.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="dynsections.js"></script>
    <link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
    <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="doxygen.css" rel="stylesheet" type="text/css" />
    <link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only-darkmode-toggle.css" rel="stylesheet" type="text/css"/>
    <!-- ... other metadata & script includes ... -->
    <script type="text/javascript" src="../doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js"></script>
    <script type="text/javascript">
        DoxygenAwesomeDarkModeToggle.init()
    </script>
    <script type="text/javascript"
        src="../doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js"></script>
    <script type="text/javascript">
        DoxygenAwesomeFragmentCopyButton.init()
    </script>
    <script type="text/javascript" src="../doxygen-awesome-css/doxygen-awesome-paragraph-link.js"></script>
    <script type="text/javascript">
        DoxygenAwesomeParagraphLink.init()
    </script>
    <script type="text/javascript" src="../doxygen-awesome-css/doxygen-awesome-interactive-toc.js"></script>
    <script type="text/javascript">
        DoxygenAwesomeInteractiveToc.init()
    </script>
</head>
<body>
    <div id="top">
        <!-- do not remove this div, it is closed by doxygen! -->
        <div id="titlearea">
            <table cellspacing="0" cellpadding="0">
                <tbody>
                    <tr style="height: 56px;">
                        <td id="projectlogo"><img alt="Logo" src="NumCppLogoDoxygen.png" /></td>
                        <td id="projectalign" style="padding-left: 0.5em;">
                            <div id="projectname">NumCpp
                                &#160;<span id="projectnumber">2.12.1</span>
                            </div>
                            <div id="projectbrief">A Templatized Header Only C++ Implementation of the Python NumPy Library</div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <!-- end header part --><!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('namespacenc_1_1edac_1_1detail.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">nc::edac::detail Namespace Reference</div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:abde37c852253de171988da5e4b775273"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacenc_1_1edac_1_1detail.html#abde37c852253de171988da5e4b775273">calculateParity</a> (const boost::dynamic_bitset&lt;&gt; &amp;data) noexcept</td></tr>
<tr class="separator:abde37c852253de171988da5e4b775273"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad3215e8486eb3a544a483e5234c856d7"><td class="memTemplParams" colspan="2">template&lt;std::size_t DataBits&gt; </td></tr>
<tr class="memitem:ad3215e8486eb3a544a483e5234c856d7"><td class="memTemplItemLeft" align="right" valign="top">constexpr bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacenc_1_1edac_1_1detail.html#ad3215e8486eb3a544a483e5234c856d7">calculateParity</a> (const std::bitset&lt; DataBits &gt; &amp;data) noexcept</td></tr>
<tr class="separator:ad3215e8486eb3a544a483e5234c856d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aea349d7b4d28ca91b85bcb3a2823c145"><td class="memTemplParams" colspan="2">template&lt;std::size_t DataBits, typename IntType , std::enable_if_t&lt; std::is_integral_v&lt; IntType &gt;, int &gt;  = 0&gt; </td></tr>
<tr class="memitem:aea349d7b4d28ca91b85bcb3a2823c145"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacenc_1_1edac_1_1detail.html#aea349d7b4d28ca91b85bcb3a2823c145">calculateParity</a> (const std::bitset&lt; DataBits &gt; &amp;data, IntType parityBit)</td></tr>
<tr class="separator:aea349d7b4d28ca91b85bcb3a2823c145"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af386b23445a4942453c69cff80ee0e20"><td class="memTemplParams" colspan="2">template&lt;std::size_t DataBits, std::size_t EncodedBits, std::enable_if_t&lt; <a class="el" href="namespacenc.html#a4cdb8bc70afcd7483d200f235181471c">greaterThan_v</a>&lt; EncodedBits, DataBits &gt;, int &gt;  = 0&gt; </td></tr>
<tr class="memitem:af386b23445a4942453c69cff80ee0e20"><td class="memTemplItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacenc_1_1edac_1_1detail.html#af386b23445a4942453c69cff80ee0e20">checkBitsConsistent</a> ()</td></tr>
<tr class="separator:af386b23445a4942453c69cff80ee0e20"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab48e88819fa377988ba14a4a5f24ce59"><td class="memTemplParams" colspan="2">template&lt;typename IntType1 , typename IntType2 , std::enable_if_t&lt; std::is_integral_v&lt; IntType1 &gt;, int &gt;  = 0, std::enable_if_t&lt; std::is_integral_v&lt; IntType2 &gt;, int &gt;  = 0&gt; </td></tr>
<tr class="memitem:ab48e88819fa377988ba14a4a5f24ce59"><td class="memTemplItemLeft" align="right" valign="top">std::vector&lt; std::size_t &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacenc_1_1edac_1_1detail.html#ab48e88819fa377988ba14a4a5f24ce59">dataBitsCovered</a> (IntType1 numDataBits, IntType2 parityBit)</td></tr>
<tr class="separator:ab48e88819fa377988ba14a4a5f24ce59"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38252e9565b5419af3453ca10754f25e"><td class="memTemplParams" colspan="2">template&lt;std::size_t DataBits, std::size_t EncodedBits, std::enable_if_t&lt; <a class="el" href="namespacenc.html#a4cdb8bc70afcd7483d200f235181471c">greaterThan_v</a>&lt; EncodedBits, DataBits &gt;, int &gt;  = 0&gt; </td></tr>
<tr class="memitem:a38252e9565b5419af3453ca10754f25e"><td class="memTemplItemLeft" align="right" valign="top">std::bitset&lt; DataBits &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacenc_1_1edac_1_1detail.html#a38252e9565b5419af3453ca10754f25e">extractData</a> (const std::bitset&lt; EncodedBits &gt; &amp;encodedBits) noexcept</td></tr>
<tr class="separator:a38252e9565b5419af3453ca10754f25e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f066ec8b196c2943ae99382eb63e2fb"><td class="memTemplParams" colspan="2">template&lt;typename IntType , std::enable_if_t&lt; std::is_integral_v&lt; IntType &gt;, int &gt;  = 0&gt; </td></tr>
<tr class="memitem:a7f066ec8b196c2943ae99382eb63e2fb"><td class="memTemplItemLeft" align="right" valign="top">constexpr bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacenc_1_1edac_1_1detail.html#a7f066ec8b196c2943ae99382eb63e2fb">isPowerOfTwo</a> (IntType n) noexcept</td></tr>
<tr class="memdesc:a7f066ec8b196c2943ae99382eb63e2fb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tests if value is a power of two.  <a href="namespacenc_1_1edac_1_1detail.html#a7f066ec8b196c2943ae99382eb63e2fb">More...</a><br /></td></tr>
<tr class="separator:a7f066ec8b196c2943ae99382eb63e2fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a279241a794bffbea6920299cf8e5c4a1"><td class="memTemplParams" colspan="2">template&lt;typename IntType , std::enable_if_t&lt; std::is_integral_v&lt; IntType &gt;, int &gt;  = 0&gt; </td></tr>
<tr class="memitem:a279241a794bffbea6920299cf8e5c4a1"><td class="memTemplItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacenc_1_1edac_1_1detail.html#a279241a794bffbea6920299cf8e5c4a1">nextPowerOfTwo</a> (IntType n)</td></tr>
<tr class="separator:a279241a794bffbea6920299cf8e5c4a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ee59971c08bfdc3e11a0245f17d5f9a"><td class="memTemplParams" colspan="2">template&lt;typename IntType , std::enable_if_t&lt; std::is_integral_v&lt; IntType &gt;, int &gt;  = 0&gt; </td></tr>
<tr class="memitem:a6ee59971c08bfdc3e11a0245f17d5f9a"><td class="memTemplItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacenc_1_1edac_1_1detail.html#a6ee59971c08bfdc3e11a0245f17d5f9a">numSecdedParityBitsNeeded</a> (IntType numDataBits)</td></tr>
<tr class="separator:a6ee59971c08bfdc3e11a0245f17d5f9a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03c06e60e061de0018d33a36239caa97"><td class="memTemplParams" colspan="2">template&lt;typename IntType , std::enable_if_t&lt; std::is_integral_v&lt; IntType &gt;, int &gt;  = 0&gt; </td></tr>
<tr class="memitem:a03c06e60e061de0018d33a36239caa97"><td class="memTemplItemLeft" align="right" valign="top">std::vector&lt; std::size_t &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacenc_1_1edac_1_1detail.html#a03c06e60e061de0018d33a36239caa97">powersOfTwo</a> (IntType n)</td></tr>
<tr class="separator:a03c06e60e061de0018d33a36239caa97"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="abde37c852253de171988da5e4b775273" name="abde37c852253de171988da5e4b775273"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abde37c852253de171988da5e4b775273">&#9670;&nbsp;</a></span>calculateParity() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool nc::edac::detail::calculateParity </td>
          <td>(</td>
          <td class="paramtype">const boost::dynamic_bitset&lt;&gt; &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p >Calculates the overall parity of the data, assumes last bit is the parity bit itself</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>the data word </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>overall parity bit value </dd></dl>

</div>
</div>
<a id="ad3215e8486eb3a544a483e5234c856d7" name="ad3215e8486eb3a544a483e5234c856d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad3215e8486eb3a544a483e5234c856d7">&#9670;&nbsp;</a></span>calculateParity() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;std::size_t DataBits&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">constexpr bool nc::edac::detail::calculateParity </td>
          <td>(</td>
          <td class="paramtype">const std::bitset&lt; DataBits &gt; &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p >Calculates the overall parity of the data, assumes last bit is the parity bit itself</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>the data word </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>overall parity bit value </dd></dl>

</div>
</div>
<a id="aea349d7b4d28ca91b85bcb3a2823c145" name="aea349d7b4d28ca91b85bcb3a2823c145"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aea349d7b4d28ca91b85bcb3a2823c145">&#9670;&nbsp;</a></span>calculateParity() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;std::size_t DataBits, typename IntType , std::enable_if_t&lt; std::is_integral_v&lt; IntType &gt;, int &gt;  = 0&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool nc::edac::detail::calculateParity </td>
          <td>(</td>
          <td class="paramtype">const std::bitset&lt; DataBits &gt; &amp;&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">IntType&#160;</td>
          <td class="paramname"><em>parityBit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Calculates the specified Hamming parity bit (1, 2, 4, 8, etc.) for the given data. Assumes even parity to allow for easier computation of parity using XOR.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>the data word </td></tr>
    <tr><td class="paramname">parityBit</td><td>the parity bit number </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>parity bit value </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::invalid_argument</td><td>if parityBit is not a power of two </td></tr>
    <tr><td class="paramname">std::bad_alloc</td><td>if unable to allocate return vector </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="af386b23445a4942453c69cff80ee0e20" name="af386b23445a4942453c69cff80ee0e20"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af386b23445a4942453c69cff80ee0e20">&#9670;&nbsp;</a></span>checkBitsConsistent()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;std::size_t DataBits, std::size_t EncodedBits, std::enable_if_t&lt; <a class="el" href="namespacenc.html#a4cdb8bc70afcd7483d200f235181471c">greaterThan_v</a>&lt; EncodedBits, DataBits &gt;, int &gt;  = 0&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">std::size_t nc::edac::detail::checkBitsConsistent </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Checks that the number of DataBits and EncodedBits are consistent</p>
<dl class="section return"><dt>Returns</dt><dd>the number of parity bits </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::runtime_error</td><td>if DataBits and EncodedBits are not consistent </td></tr>
    <tr><td class="paramname">std::runtime_error</td><td>if the number of data bits does not represent a valid Hamming SECDED code </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ab48e88819fa377988ba14a4a5f24ce59" name="ab48e88819fa377988ba14a4a5f24ce59"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab48e88819fa377988ba14a4a5f24ce59">&#9670;&nbsp;</a></span>dataBitsCovered()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename IntType1 , typename IntType2 , std::enable_if_t&lt; std::is_integral_v&lt; IntType1 &gt;, int &gt;  = 0, std::enable_if_t&lt; std::is_integral_v&lt; IntType2 &gt;, int &gt;  = 0&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt; std::size_t &gt; nc::edac::detail::dataBitsCovered </td>
          <td>(</td>
          <td class="paramtype">IntType1&#160;</td>
          <td class="paramname"><em>numDataBits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">IntType2&#160;</td>
          <td class="paramname"><em>parityBit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Returns the indices of all data bits covered by a specified parity bit in a bitstring of length numDataBits. The indices are relative to DATA BITSTRING ITSELF, NOT including parity bits.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">numDataBits</td><td>the number of data bits to encode </td></tr>
    <tr><td class="paramname">parityBit</td><td>the parity bit number </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of Hamming SECDED parity bits </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::invalid_argument</td><td>if parityBit is not a power of two </td></tr>
    <tr><td class="paramname">std::bad_alloc</td><td>if unable to allocate return vector </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a38252e9565b5419af3453ca10754f25e" name="a38252e9565b5419af3453ca10754f25e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a38252e9565b5419af3453ca10754f25e">&#9670;&nbsp;</a></span>extractData()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;std::size_t DataBits, std::size_t EncodedBits, std::enable_if_t&lt; <a class="el" href="namespacenc.html#a4cdb8bc70afcd7483d200f235181471c">greaterThan_v</a>&lt; EncodedBits, DataBits &gt;, int &gt;  = 0&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::bitset&lt; DataBits &gt; nc::edac::detail::extractData </td>
          <td>(</td>
          <td class="paramtype">const std::bitset&lt; EncodedBits &gt; &amp;&#160;</td>
          <td class="paramname"><em>encodedBits</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p >Returns the Hamming SECDED decoded bits from the endoded bits. Assumes that the DataBits and EncodedBits have been checks for consistancy already</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">encodedBits</td><td>the Hamming SECDED encoded word </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>data bits from the encoded word </dd></dl>

</div>
</div>
<a id="a7f066ec8b196c2943ae99382eb63e2fb" name="a7f066ec8b196c2943ae99382eb63e2fb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7f066ec8b196c2943ae99382eb63e2fb">&#9670;&nbsp;</a></span>isPowerOfTwo()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename IntType , std::enable_if_t&lt; std::is_integral_v&lt; IntType &gt;, int &gt;  = 0&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">constexpr bool nc::edac::detail::isPowerOfTwo </td>
          <td>(</td>
          <td class="paramtype">IntType&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Tests if value is a power of two. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">n</td><td>integer value </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>bool true if value is a power of two, else false </dd></dl>

</div>
</div>
<a id="a279241a794bffbea6920299cf8e5c4a1" name="a279241a794bffbea6920299cf8e5c4a1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a279241a794bffbea6920299cf8e5c4a1">&#9670;&nbsp;</a></span>nextPowerOfTwo()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename IntType , std::enable_if_t&lt; std::is_integral_v&lt; IntType &gt;, int &gt;  = 0&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">std::size_t nc::edac::detail::nextPowerOfTwo </td>
          <td>(</td>
          <td class="paramtype">IntType&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Calculates the next power of two after n </p><blockquote class="doxtable">
<blockquote class="doxtable">
<blockquote class="doxtable">
<p >&zwj;_next_power_of_two(768) </p>
</blockquote>
</blockquote>
</blockquote>
<p>1024 </p><blockquote class="doxtable">
<blockquote class="doxtable">
<blockquote class="doxtable">
<p >&zwj;_next_power_of_two(4) </p>
</blockquote>
</blockquote>
</blockquote>
<p>8</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">n</td><td>integer value </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>next power of two </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::invalid_argument</td><td>if input value is less than zero </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a6ee59971c08bfdc3e11a0245f17d5f9a" name="a6ee59971c08bfdc3e11a0245f17d5f9a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6ee59971c08bfdc3e11a0245f17d5f9a">&#9670;&nbsp;</a></span>numSecdedParityBitsNeeded()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename IntType , std::enable_if_t&lt; std::is_integral_v&lt; IntType &gt;, int &gt;  = 0&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">std::size_t nc::edac::detail::numSecdedParityBitsNeeded </td>
          <td>(</td>
          <td class="paramtype">IntType&#160;</td>
          <td class="paramname"><em>numDataBits</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Calculates the number of needed Hamming SECDED parity bits to encode the data</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">numDataBits</td><td>the number of data bits to encode </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of Hamming SECDED parity bits </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::invalid_argument</td><td>if input value is less than zero </td></tr>
    <tr><td class="paramname">std::runtime_error</td><td>if the number of data bits does not represent a valid Hamming SECDED code </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a03c06e60e061de0018d33a36239caa97" name="a03c06e60e061de0018d33a36239caa97"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a03c06e60e061de0018d33a36239caa97">&#9670;&nbsp;</a></span>powersOfTwo()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename IntType , std::enable_if_t&lt; std::is_integral_v&lt; IntType &gt;, int &gt;  = 0&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt; std::size_t &gt; nc::edac::detail::powersOfTwo </td>
          <td>(</td>
          <td class="paramtype">IntType&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Calculates the first n powers of two</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">n</td><td>integer value </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>first n powers of two </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::bad_alloc</td><td>if unable to allocate for return vector </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacenc.html">nc</a></li><li class="navelem"><a class="el" href="namespacenc_1_1edac.html">edac</a></li><li class="navelem"><a class="el" href="namespacenc_1_1edac_1_1detail.html">detail</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4 </li>
  </ul>
</div>
</body>
</html>
